##### #####################################################################
#####           
#####                         Master script                                 


rm(list= ls())


## Create appropriate directory structure

dir.create("working")
dir.create("working/stan_out")
dir.create("working/stan_out/model2")
dir.create("working/stan_out/model2_control")
dir.create("working/stm_out")

dir.create("analysis/plots")
dir.create("analysis/plots/topic")


## Run scripts (note: will take approximately 6 days on a good computer)

system("Rscript 01_prep_fcm.R")
system("Rscript 02_estimate_embeddings.R")
system("Rscript 03_prep_dictionaries.R")
system("Rscript 04_apply_dictionaries.R")
system("Rscript 05_apply_repetition.R")
system("Rscript 06_apply_complexity.R")
system("Rscript 07_prep_meta_data.R")
system("Rscript 08_stan.R")
system("Rscript 09_stan_analysis.R")
system("Rscript 10_topic_model_prep.R")
system("Rscript 11_topic_model_analysis.R")
system("Rscript 12_diagnostics.R")